package com.ceba.test.base.enums;

/**
 * 二维码文件是否上传成功
 * Created by liguangyao on 4/13/2020.
 */
public enum QrFileUploadFlagEnum {

    DEFAULT_NONE(0,"系统未开启二维码，无需上传"),
    UPLOAD_FAILURE(1,"未上传成功"),
    UPLOAD_SUCCESS(2,"上传成功");
    
    private int code;
    private String desc;

    private QrFileUploadFlagEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static QrFileUploadFlagEnum from(int code) {
        switch (code) {
            case 0:
                return DEFAULT_NONE;
            case 1:
                return UPLOAD_FAILURE;
            case 2:
                return UPLOAD_SUCCESS;
            default:
                return DEFAULT_NONE;
        }
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
